package com.foursquare.stats.model;

/**
 * @author Nick Burton (charlesnicholasburton [at] gmail.com)
 */
public class StatsParser {
	
	private UserStats mUserStats;
	public StatsParser(UserStats userStats){
		mUserStats = userStats;
	}	
	
	public UserStats getParsedStats(){
		int mayorCount = Integer.valueOf(mUserStats.getMayorCount());
		int badgeCount = Integer.valueOf(mUserStats.getBadgeCount());
		String mayorString = mUserStats.getMayorCount();
		String badgeString = mUserStats.getBadgeCount();
		
		if(mayorCount < 10){
			mayorString = "  "+mayorString;
		} else if(mayorCount < 100 ){
			mayorString = " "+mayorString;
		}
		if(badgeCount < 10){
			badgeString = "  "+badgeString;
		} else if(badgeCount < 100 ){
			badgeString = " "+badgeString;
		}
		return new UserStats(mayorString,badgeString,
				 		   "@"+mUserStats.getVenue(),
				 		   mUserStats.getUserID(),
				 		   mUserStats.getUserName());
	}
}